import datetime
from google.appengine.ext import db
from google.appengine.tools import bulkloader
import model

class PresidentLoader(bulkloader.Loader):
  def __init__(self):
    bulkloader.Loader.__init__(self, 'President',
                               [('id', int),
                                ('name', str),
                                ('start_date', lambda x: datetime.datetime.strptime(x, '%m/%d/%Y').date()),
                                ('end_date', lambda x: datetime.datetime.strptime(x, '%m/%d/%Y').date()),
                                ('terms', int),
                                ('party', int)])
loaders = [PresidentLoader]